- project = resource_access_token.user.projects.first
- group = resource_access_token.user.groups.first

.gl-responsive-table-row{ role: 'row' }
  .table-section.section-10
    .table-mobile-header{ role: 'rowheader' }
      = _('Name')
    .table-mobile-content.gl-white-space-normal.gl-word-break-word.gl-pr-5
      = resource_access_token.name
  .table-section.section-15
    .table-mobile-header{ role: 'rowheader' }
      = _('Scopes')
    .table-mobile-content.gl-white-space-normal
      = resource_access_token.scopes.join(', ')
  .table-section.section-15
    .table-mobile-header{ role: 'rowheader' }
      = _('Project or Group')
    .table-mobile-content.gl-white-space-normal.gl-word-break-word.gl-pr-5
      - if project
        = link_to project.name, project_url(project)
      - else
        = link_to group.name, group_url(group)
  .table-section.section-20
    .table-mobile-header{ role: 'rowheader' }
      = _('Creator')
    .table-mobile-content
      = render 'shared/credentials_inventory/users/user_detail', user: resource_access_token.user.created_by
  .table-section.section-10
    .table-mobile-header{ role: 'rowheader' }
      = _('Created on')
    .table-mobile-content
      = resource_access_token.created_at&.to_date
  .table-section.section-10
    .table-mobile-header{ role: 'rowheader' }
      = _('Last used')
    .table-mobile-content
      = resource_access_token.last_used_at&.to_date || _('Never')
  .table-section.section-10
    .table-mobile-header{ role: 'rowheader' }
      = _('Expires')
    .table-mobile-content
      = resource_access_token.expires_at&.to_date || _('Never')
  .table-section.section-10
    .table-mobile-header{ role: 'rowheader' }
    .table-mobile-content
      - if project
        = link_button_to _('Revoke'), admin_credential_resource_revoke_path(credential_id: resource_access_token, resource_id: project.id, resource_type: 'Project'), method: :put, data: { confirm: _('Are you sure you want to revoke this project access token? This action cannot be undone.') }, variant: :danger, category: :secondary
      - else
        = link_button_to _('Revoke'), admin_credential_resource_revoke_path(credential_id: resource_access_token, resource_id: group.id, resource_type: 'Group'), method: :put, data: { confirm: _('Are you sure you want to revoke this group access token? This action cannot be undone.') }, variant: :danger, category: :secondary
